import { _decorator, Component, director, find, Node } from 'cc';
import { Canvas } from './Canvas';
const { ccclass, property } = _decorator;

@ccclass('Next')
export class Next extends Component {
    start() {
        if(find('Canvas').getComponent(Canvas).level == 9){
            this.node.destroy()  
        }
        this.node.on(Node.EventType.TOUCH_START,(e)=>{
            director.loadScene('level'+(find('Canvas').getComponent(Canvas).level+1))
        },this)
    }

    update(deltaTime: number) {
        
    }
}


